package com.hbase;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class HBaseUtility {

	static {
		try {
			Class.forName("com.salesforce.phoenix.jdbc.PhoenixDriver");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}

	public static Connection getConnection() {
		String getDBConnectionString = "jdbc:phoenix:dbcenter03,dbcenter01,dbcenter02,dbcenter04,dbcenter05,dbcenter06,dbcenter07,dbcenter08,dbcenter09,dbcenter10,dbcenter11,dbcenter13,dbcenter14"; // 从配置文件中读取链接字符串
		try {
			Connection _Connection = DriverManager
					.getConnection(getDBConnectionString);
			return _Connection;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}

}